package com.bawei.model_sevent.Activity.Fragemnt;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;

import androidx.fragment.app.Fragment;

import com.bawei.model_sevent.Activity.IM.ConversationListFragment;
import com.bawei.model_sevent.R;
import com.hyphenate.easeui.widget.EaseTitleBar;


public class BlankFragment_messages extends Fragment {
    private EaseTitleBar mainTitleBar;
    private LinearLayout mainLl;
    private Button huihua;
    private Button contact;
    private Button my;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View inflate = inflater.inflate(R.layout.fragment_blank_messages, container, false);
        mainTitleBar = inflate.findViewById(R.id.main_title_bar);
        mainLl = inflate.findViewById(R.id.main_ll);
        huihua = inflate.findViewById(R.id.huihua);
        contact = inflate.findViewById(R.id.contact);
        my = inflate.findViewById(R.id.my);
        //设置右侧菜单图标
        mainTitleBar.setRightImageResource(R.drawable.main);
//设置标题
        mainTitleBar.setTitle("标题");
//设置标题位置
        mainTitleBar.setTitlePosition(EaseTitleBar.TitlePosition.Left);
//设置右侧菜单图标的点击事件
        mainTitleBar.setOnRightClickListener(new EaseTitleBar.OnRightClickListener() {
            @Override
            public void onRightClick(View view) {
                //弹出菜单  创建群聊 添加好友
            }
        });
//设置返回按钮的点击事件
        mainTitleBar.setOnBackPressListener(new EaseTitleBar.OnBackPressListener() {
            @Override
            public void onBackPress(View view) {
                
            }
        });
        huihua.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ConversationListFragment conversationListFragment = new ConversationListFragment();
                getActivity().getSupportFragmentManager().beginTransaction().add(R.id.main_ll,conversationListFragment).commit();
            }
        });
        return inflate;
    }
    
}